<%@ page language="java" import="java.util.*"
	import="com.sellerSystem.vo.*" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" dir="ltr">

<head>
<link rel="stylesheet" type="text/css" href="css/css.css" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>
<title>商品詳情</title>
<style>
.div {
	height: 470px;
}

.com {
	height: 80px;
}

#ta11 {
	width: 100%;
	font-size: 25px;
	text-align: center;
	vertical-align: middle;
}

#pic {
	height: 200px;
	width: 200px;
}
</style>
</head>

<body onResize="Resize()" onLoad="Resize()">
	<div class="menu">
		<ul>
			<li style="width: 0px;"><a></a></li>
			<li class="active"><a href="loginSuc.jsp" class="home">首页</a></li>
			<li><a href="info.jsp" class="account">个人信息</a></li>
			<li><a href="orderform.jsp" class="wishlist">订单查询</a></li>
			<li style="float: right;">欢迎<b>${seller.sellerName}</b>来到您的个人商铺！
			</li>
			<li style="float: right;"><a href="index.html" class="login">退出登录</a></li>
		</ul>
	</div>
	<!--里面内容总高度为550px；-->
	<center>
		<div class="com">
			<img alt="Site Name" src="images/commodity1.jpg">
		</div>
	</center>
	<div class="cart-info">
		<div class="div">




			<table id="ta11"></table>


		</div>
	</div>




	<div class="icart-footer">
		<div class="icart-footer-top">
			<div style="width: 1000px; margin: 0 auto;"></div>
		</div>
		<div class="icart-footer-container">
			<div class="column_footer" style="width: 500px;">
				<h3>关于我们</h3>
				<div class="footer_description">......</div>
			</div>

			<div class="column_footer" style="width: 150px;">
				<h3>客户服务</h3>
				<ul>
					<li><a href="#">隐私声明</a></li>
					<li><a href="#">联系我们</a></li>
					<li><a href="#">地图</a></li>
				</ul>
			</div>

			<div class="column_footer" style="width: 150px;">
				<h3>其他</h3>
				<ul>
					<li><a href="#">主要品牌</a></li>
					<li><a href="#">关联企业</a></li>
				</ul>
			</div>


			<div class="column_footer" style="margin-right: 0px;">
				<h3>社会服务</h3>
				<ul class="social">
					<li class="twitter"><a href="#">Twitter Username</a></li>
					<li class="facebook"><a href="#">Facebook</a></li>
					<li class="rss"><a href="#">RSS Feed</a></li>
				</ul>
			</div>
			<div class="clearfix"></div>
		</div>
		<div class="icart-footer-bottom">
			<div style="width: 1000px; margin: 0 auto;">
				
				<ul>
					<li style="float: right; padding-top: 10px; list-style: none;"><a
						href="#">&copy; Copyright &copy; 南京大学 大数据与移动云计算
							第二小组&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
				</ul>
				<div class="clearfix"></div>
			</div>

		</div>
	</div>
	<div style="display: none">
		<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540'
			language='JavaScript' charset='utf-8'></script>
	</div>
</body>
<script>
	var thisURL = document.URL;
	var showval = thisURL.split("=")[1];
	var I = null;
	//进入个人店铺页面显示所有个人商品
	$(document)
			.ready(
					function() {
						$
								.ajax(
										"loginSuc",
										{
											type : "POST",
											dataType : 'text',
											success : function(data) {
												//alert(data);
												var jsonObj = eval("(" + data
														+ ")");

												$("#ta11")
														.html(
																"<tr><th width='10%'>商品序号</th><th width='10%'>商品名称</th><th width='15%'>商品图片</th><th width='10%'>商品种类</th><th width='10%'>商品单价</th><th width='10%'>商品库存量</th><th width='15%'>商品描述</th><th width='10%'>质量保障</th><th width='10%'>更改商品</th></tr>")
												$
														.each(
																jsonObj,
																function(i,
																		item) {
																	I = item;
																	if (item.commodityId == showval) {
																		$(
																				"#ta11")
																				.append(
																						"<tr><td>"
																								+ item.commodityId
																								+ "</td><td>"
																								+ item.commodityName
																								+ "</td><td>"
																								+ "<img id='pic' src=" + item.commodityPic + ">"
																								+ "</td><td>"
																								+ item.commodityKinds
																								+ "</td><td>"
																								+ item.commodityPrice
																								+ "</td><td>"
																								+ item.commodityNumber
																								+ "</td><td>"
																								+ item.commodityDescribe
																								+ "</td><td>"
																								+ item.commodityGuaranty
																								+ "</td><td>"
																								+ "<a href='modifycommodity.jsp?data="
																								+ item.commodityId
																								+ "'><input type=button value='修改商品'></a><br><br><p><button onclick='f()'>删除商品</button></p>"
																								+ "</td></tr>")
																	}
																	//alert(item.sellerId + ","  + item.sellerName);

																});

											}
										});
					});

	function f() {

		$.ajax("deletecommodity", {
			data : I,
			type : "POST",
			success : function() {
				//alert("ok");
				alert("删除成功");
				window.location.href = "deletecommodity.jsp";
			}

		});
	}
</script>

<script language="JavaScript" type="text/javascript">
	$(function() {
		var winWidth, winHeight;
		Resize = function() {
			winWidth = $(window).width(), winHeight = $(window).height();
		}
	});
</script>
</html>
